package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.MaterielOutboundRecordMapper;
import com.ruoyi.hospital.domain.MaterielOutboundRecord;
import com.ruoyi.hospital.service.IMaterielOutboundRecordService;

/**
 * 物资出库记录Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-10
 */
@Service
public class MaterielOutboundRecordServiceImpl implements IMaterielOutboundRecordService 
{
    @Autowired
    private MaterielOutboundRecordMapper materielOutboundRecordMapper;

    /**
     * 查询物资出库记录
     * 
     * @param id 物资出库记录主键
     * @return 物资出库记录
     */
    @Override
    public MaterielOutboundRecord selectMaterielOutboundRecordById(Long id)
    {
        return materielOutboundRecordMapper.selectMaterielOutboundRecordById(id);
    }

    /**
     * 查询物资出库记录列表
     * 
     * @param materielOutboundRecord 物资出库记录
     * @return 物资出库记录
     */
    @Override
    public List<MaterielOutboundRecord> selectMaterielOutboundRecordList(MaterielOutboundRecord materielOutboundRecord)
    {
        return materielOutboundRecordMapper.selectMaterielOutboundRecordList(materielOutboundRecord);
    }

    /**
     * 新增物资出库记录
     * 
     * @param materielOutboundRecord 物资出库记录
     * @return 结果
     */
    @Override
    public int insertMaterielOutboundRecord(MaterielOutboundRecord materielOutboundRecord)
    {
        materielOutboundRecord.setCreateTime(DateUtils.getNowDate());
        return materielOutboundRecordMapper.insertMaterielOutboundRecord(materielOutboundRecord);
    }

    /**
     * 修改物资出库记录
     * 
     * @param materielOutboundRecord 物资出库记录
     * @return 结果
     */
    @Override
    public int updateMaterielOutboundRecord(MaterielOutboundRecord materielOutboundRecord)
    {
        materielOutboundRecord.setUpdateTime(DateUtils.getNowDate());
        return materielOutboundRecordMapper.updateMaterielOutboundRecord(materielOutboundRecord);
    }

    /**
     * 批量删除物资出库记录
     * 
     * @param ids 需要删除的物资出库记录主键
     * @return 结果
     */
    @Override
    public int deleteMaterielOutboundRecordByIds(Long[] ids)
    {
        return materielOutboundRecordMapper.deleteMaterielOutboundRecordByIds(ids);
    }

    /**
     * 删除物资出库记录信息
     * 
     * @param id 物资出库记录主键
     * @return 结果
     */
    @Override
    public int deleteMaterielOutboundRecordById(Long id)
    {
        return materielOutboundRecordMapper.deleteMaterielOutboundRecordById(id);
    }
}
